#!/bin/bash

gpio_group=(499 498 496 497 437 420 433 432 430 436 323)
sleepTime=0.1
# Define a function to toggle the pins
toggle_pins()
{
    for((i=0;i<${#gpio_group[*]};i++))
    do
#	    echo ${gpio_group[i]}
            /usr/bin/beagle-gpio set ${gpio_group[i]}
            sleep $sleepTime
    done

    for((i=0;i<${#gpio_group[*]};i++))
    do
            /usr/bin/beagle-gpio clear ${gpio_group[i]}
            sleep $sleepTime
    done
}

# Call the toggle_pins function
cat /sys/bus/iio/devices/iio\:device0/in_voltage7_raw
toggle_pins
cat /sys/bus/iio/devices/iio\:device0/in_voltage7_raw

